<template>
    <div class="approveItem" @click="goToDetail">
        <h1 class="titleDesc"><span class="titleIcon">假</span>{{itemData && itemData.name}}的请假<span class="descDisplay sumDay">(共{{itemData.leave_day}}天)</span><span class="descDisplay">{{itemData && itemData.leave_name}}</span><i class=" descDisplay Detail">></i></h1>
        <ul class="disList">
            <li><i class="icon-time"></i><span>{{itemData && itemData.start_time}}&nbsp;{{itemData.Leave_st_section === '1' ? '上午' : '下午'}}</span><span>&nbsp;&nbsp;至&nbsp;&nbsp;{{itemData.end_time}}&nbsp;{{itemData.Leave_end_section === '1' ? '上午' : '下午'}}</span></li>
            <li><i class="icon-dept"></i><span>{{itemData && itemData.dept_name}}</span></li>
            <li><i class="icon-approve"></i><span :class="classObject">{{itemData.auditStatus || itemData.activityFlag || itemData.audit_status_name}}</span></li>
        </ul>
        <div class="bgColor"></div>    
    </div>

</template>

<script>

export default {
  name: 'app',
  data() {
    return {
      endDate:"2017.09.20 下午",
      dept:"招商集团总经办",
      approve:"部门领导审批",

    };
  },
//   props:["itemData",'type'],
  props:{
      "itemData":{
          type:Object,
          default:function(){
              return {};
          }
      },
      'type':{
      }
  
  },
  methods: {
      goToDetail:function(){
          //  let params = {
          //     applyId:obj.applyId ,
          //     exectionId: obj.exectionId
          //  }
            let params = {
                AI: this.itemData.id||this.itemData.busi_id,
                EI: this.itemData.exectionId,
                cId: this.itemData.cId
            }

          if (this.type == 'done') {
              localStorage.setItem('updateId',JSON.stringify(params));
              location.href = '/module/readDetail.html';
          } else {
              localStorage.setItem('updateId',JSON.stringify(params))
              location.href = '/module/readDetail.html';
          }
           
            
      }
  },
  components: {


  },
  computed:{
        classObject: function () {
            if (!this.itemData) {
                return;
            }
            var status = this.itemData.auditStatus || this.itemData.activityFlag || this.itemData.audit_status_name;

            if (status.indexOf('拒绝') > -1) {
                return {'reject':true};
            } else if (status.indexOf('审批中') > -1) {
                return {'waitAppro':true};
            } else{
                return {'Appro':true};
            }

        }
  },
  watch: {

  },
  mounted: function() {

  }
};
</script>

<style lang="less" scoped>

  .approveItem{
      padding-top:0.26rem;
      background-color:#fff;
      .titleDesc{
          padding-left:0.9rem;
          padding-right:0.6rem;
          font-size:0.4rem;
          position: relative;
          line-height:0.48rem;
          .titleIcon{
            position:absolute;
            font-size:0.32rem;
            left:0.3rem;
            width:0.48rem;
            height:0.48rem;
            line-height:0.48rem;
            right: 0;
            top: 0;
            bottom: 0;
            margin:auto 0;
            text-align:center;
            font-weight:500;
            color:#fff;
            background-color:#007DE4;
            border-radius:50%;
          }
          .descDisplay{
            color:#999;
            float:right;
            margin-left:0.16rem;
            font-size:0.32rem;
            padding:0;
          }
          .sumDay{
              margin-right:0.3rem;
          }
          .Detail{
            position:absolute;
            right: 0;
            top: 0;
            bottom: 0;
            margin:auto 0;
            width:0.6rem;
            text-align:center;
            height:0.48rem;
            line-height:0.48rem;
          }
      }
      .disList {
          margin-top:0.26rem;
          margin-bottom:0.16rem;
          li{
              line-height:0.52rem;
              height:0.52rem;
              font-size:0.32rem;
              // font-weight:600;
              color:#999;
              padding-left:0.5rem;
              i{
                margin-right:0.1rem;
              }
              .leaderAppr{
                color:#0079E3;
              }

                .reject{
                    color:#E24040;
                }
                .waitAppro{
                    color:#D8D41D;
                }
                .Appro{
                    color:green;                
                }

          }
      }
      .bgColor{
        height:0.02rem;
        background-color:#F3F3F3;
      }
  }

</style>

